//
// Unihan Input Method
//
// Copyright © 2002-2007 Sun Wah Linux Ltd.
//
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
// USA
//
// $Id: upimdpref.c 757 2007-05-10 08:19:31Z roger $
//


#ifdef HAVE_CONFIG_H
#  include <config.h>
#endif

#include <gnome.h>
#include <glade/glade.h>
#include <gtk/gtk.h>
#include <gconf/gconf-client.h>

#include "prefedit.h"
#include "upimdpref.h"
#include "upimdpref_cb.h"

//int check=-1;
//int a=0,b=0,c=0;
//int check=-1;

//zzc
//GtkWidget *w;
//data_init();
//xml_upimdpref = glade_xml_new(UNIHAN_DATA_DIR "/xml/upimdpref.glade",
//			"windowupimdpref", NULL);
	
void
upimdpref_main (void)
{
	GtkWidget *w;
	GtkTextBuffer *buf1;
	GtkTextIter iter;
	
    data_init();

	xml_upimdpref = glade_xml_new(UNIHAN_DATA_DIR "/xml/upimdpref.glade",
			"windowupimdpref", NULL);
	
	


/*********************数据初始化**********************/

	gchar *active_button;


	if(inputstyle)
		active_button = "radiobutton2";
	else
		active_button = "radiobutton1";
	w = glade_xml_get_widget(xml_upimdpref, active_button);
	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), TRUE);

	if(double_pin_input)
		active_button = "radiobutton4";
	else
		active_button = "radiobutton3";
	w = glade_xml_get_widget(xml_upimdpref, active_button);
	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), TRUE);

	w = glade_xml_get_widget(xml_upimdpref, "checkbutton1");
	if(dynamic_adjust_phrasefeq)
       	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), TRUE);
	else
		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), FALSE);

	w = glade_xml_get_widget(xml_upimdpref, "checkbutton2");
	if(dynamic_adjust_wordfeq)
	   	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), TRUE);
	else
		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), FALSE);

	w = glade_xml_get_widget(xml_upimdpref, "checkbutton3");
	if(lately_inputword_first)
	  	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), TRUE);
	else
		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), FALSE);

	w = glade_xml_get_widget(xml_upimdpref, "comboboxentry6");
	gtk_combo_box_set_active(GTK_COMBO_BOX(w), double_pin_strategy);
	if(double_pin_input)
		gtk_widget_set_sensitive(GTK_WIDGET(w), TRUE);
	else
		gtk_widget_set_sensitive(GTK_WIDGET(w), FALSE);
	gtk_entry_set_editable(GTK_ENTRY(GTK_BIN(w)->child),FALSE);

	w = glade_xml_get_widget(xml_upimdpref, "comboboxentry1");
	gtk_combo_box_set_active(GTK_COMBO_BOX(w), candidateword_num-3);
	gtk_entry_set_editable(GTK_ENTRY(GTK_BIN(w)->child),FALSE);

	if(ch_en_switchkey)
		active_button = "radiobutton6";
	else
		active_button = "radiobutton5";
	w = glade_xml_get_widget(xml_upimdpref, active_button);
	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), TRUE);

	w = glade_xml_get_widget(xml_upimdpref, "comboboxentry2");
	gtk_combo_box_set_active(GTK_COMBO_BOX(w), multicandidate_pagekey);
	gtk_entry_set_editable(GTK_ENTRY(GTK_BIN(w)->child),FALSE);

	w = glade_xml_get_widget(xml_upimdpref, "comboboxentry3");
	gtk_combo_box_set_active(GTK_COMBO_BOX(w), phrase_define_wordkey);
	gtk_entry_set_editable(GTK_ENTRY(GTK_BIN(w)->child),FALSE);
	
	w = glade_xml_get_widget(xml_upimdpref, "comboboxentry4");
	gtk_combo_box_set_active(GTK_COMBO_BOX(w), enter_define);
	gtk_entry_set_editable(GTK_ENTRY(GTK_BIN(w)->child),FALSE);

	w = glade_xml_get_widget(xml_upimdpref, "comboboxentry5");
	gtk_combo_box_set_active(GTK_COMBO_BOX(w), softkeyboard_key-'a');
	gtk_entry_set_editable(GTK_ENTRY(GTK_BIN(w)->child),FALSE);
	
	
	
	w = glade_xml_get_widget(xml_upimdpref, "checkbutton4");
	if(shengmu_customize & 0x01)
	  	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), TRUE);
	else
		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), FALSE);

	w = glade_xml_get_widget(xml_upimdpref, "checkbutton5");
	if(shengmu_customize & 0x04)
	   	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), TRUE);
	else
		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), FALSE);
	
	w = glade_xml_get_widget(xml_upimdpref, "checkbutton6");
	if(shengmu_customize & 0x02)
	  	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), TRUE);
	else
		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), FALSE);

	w = glade_xml_get_widget(xml_upimdpref, "checkbutton7");
	if(shengmu_customize & 0x10)
	   	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), TRUE);
	else
		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), FALSE);

	w = glade_xml_get_widget(xml_upimdpref, "checkbutton8");
	if(shengmu_customize & 0x20)
	   	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), TRUE);
	else
		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), FALSE);
	
	w = glade_xml_get_widget(xml_upimdpref, "checkbutton9");
	if(shengmu_customize & 0x08)
	   	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), TRUE);
	else
		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), FALSE);
	
	w = glade_xml_get_widget(xml_upimdpref, "checkbutton10");
	if(yunmu_customize & 0x01)
     	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), TRUE);
	else
		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), FALSE);

	w = glade_xml_get_widget(xml_upimdpref, "checkbutton11");
	if(yunmu_customize & 0x02)
     	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), TRUE);
	else
		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), FALSE);
	
	w = glade_xml_get_widget(xml_upimdpref, "checkbutton12");
	if(yunmu_customize & 0x04)
	   	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), TRUE);
	else
		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), FALSE);

	w = glade_xml_get_widget(xml_upimdpref, "checkbutton13");
	if(yunmu_customize & 0x08)
	   	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), TRUE);
	else
		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), FALSE);

	w = glade_xml_get_widget(xml_upimdpref, "checkbutton14");
	if(yunmu_customize & 0x10)
	   	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), TRUE);
	else
		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), FALSE);
	
				
	w = glade_xml_get_widget(xml_upimdpref, "checkbutton25");
	if(use_mohuyin){
		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), TRUE);
	}else{
		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), FALSE);
			
		w = glade_xml_get_widget(xml_upimdpref, "checkbutton4");
		gtk_widget_set_sensitive(w,FALSE);
		w = glade_xml_get_widget(xml_upimdpref, "checkbutton5");
		gtk_widget_set_sensitive(w,FALSE);
		w = glade_xml_get_widget(xml_upimdpref, "checkbutton6");
		gtk_widget_set_sensitive(w,FALSE);
		w = glade_xml_get_widget(xml_upimdpref, "checkbutton7");
		gtk_widget_set_sensitive(w,FALSE);
		w = glade_xml_get_widget(xml_upimdpref, "checkbutton8");
		gtk_widget_set_sensitive(w,FALSE);
		w = glade_xml_get_widget(xml_upimdpref, "checkbutton9");
		gtk_widget_set_sensitive(w,FALSE);
		w = glade_xml_get_widget(xml_upimdpref, "checkbutton10");
		gtk_widget_set_sensitive(w,FALSE);
		w = glade_xml_get_widget(xml_upimdpref, "checkbutton11");
		gtk_widget_set_sensitive(w,FALSE);
		w = glade_xml_get_widget(xml_upimdpref, "checkbutton12");
		gtk_widget_set_sensitive(w,FALSE);
		w = glade_xml_get_widget(xml_upimdpref, "checkbutton13");
		gtk_widget_set_sensitive(w,FALSE);
		w = glade_xml_get_widget(xml_upimdpref, "checkbutton14");
		gtk_widget_set_sensitive(w,FALSE);
	}
	
	if(GBK_support)
		active_button = "radiobutton10";
	else
		active_button = "radiobutton9";
	w = glade_xml_get_widget(xml_upimdpref, active_button);
	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), TRUE);	

	if(simplify_chinese)
		active_button = "radiobutton11";
	else
		active_button = "radiobutton12";
	w = glade_xml_get_widget(xml_upimdpref, active_button);
	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), TRUE);

	if(english_default)
		active_button = "radiobutton14";
	else
		active_button = "radiobutton13";
	w = glade_xml_get_widget(xml_upimdpref, active_button);
	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), TRUE);

	w = glade_xml_get_widget(xml_upimdpref, "checkbutton15");
	if(itphrase)
	   	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), TRUE);
	else
		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), FALSE);

	w = glade_xml_get_widget(xml_upimdpref, "checkbutton16");
	if(digit_follow_letter)
	   	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), TRUE);
	else
		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), FALSE);

	w = glade_xml_get_widget(xml_upimdpref, "checkbutton17");
	if(itphrase_automind)
	   	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), TRUE);
	else
		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), FALSE);

	w = glade_xml_get_widget(xml_upimdpref, "checkbutton18");
	if(autoadjust_wordorder)
	   	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), TRUE);
	else
		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), FALSE);

	w = glade_xml_get_widget(xml_upimdpref, "checkbutton19");
	if(store_latelyinput_word)
	   	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), TRUE);
	else
		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), FALSE);

	w = glade_xml_get_widget(xml_upimdpref, "checkbutton20");
	if(inputstyle)
		gtk_widget_set_sensitive(GTK_WIDGET(w), FALSE);
	else
		gtk_widget_set_sensitive(GTK_WIDGET(w), TRUE);
	if(letter_select_lookup)
	   	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), TRUE);
	else
		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), FALSE);
	
	w = glade_xml_get_widget(xml_upimdpref, "checkbutton21");
	if(autohide_lowfeqword)
	   	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), TRUE);
	else
		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), FALSE);
		
	w = glade_xml_get_widget(xml_upimdpref, "checkbutton22");
	if(cursor_follow)
	   	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), TRUE);
	else
		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), FALSE);
	
	w = glade_xml_get_widget(xml_upimdpref, "checkbutton23");
	if(vstate_space)
	   	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), TRUE);
	else
		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), FALSE);
	
	w = glade_xml_get_widget(xml_upimdpref, "checkbutton24");
	gtk_widget_set_sensitive(GTK_WIDGET(w), double_pin_input);
	if(double_pin_showInfo)
	   	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), TRUE);
	else
		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), FALSE);

	w = glade_xml_get_widget(xml_upimdpref, "textview1");
 	
 	buf1 = gtk_text_view_get_buffer(GTK_TEXT_VIEW(w));
 	
 	gtk_text_buffer_set_text(buf1,"",-1);
        
    gtk_text_buffer_get_end_iter(buf1,&iter);
 	//gtk_text_buffer_insert(buf1,&iter,"声母        韵母        零声母音节的韵母\n",-1);    
       // gtk_text_buffer_insert(buf1,&iter,"声母\n",-1); 
	//gtk_text_buffer_insert(buf1,&iter,"声母        韵母        零声母音节的韵母\n",-1); 
	//gtk_text_buffer_insert(buf1,&iter,"声母        韵母        零声母音节的韵母\n",-1); 
	
    if(double_pin_strategy == 2)
    {
 		gtk_text_buffer_get_end_iter(buf1,&iter);
 		//gtk_text_buffer_insert(buf1,&iter,"ch = U      ai = S   a = AA\n",-1);
 		gtk_text_buffer_insert(buf1,&iter,"紫光拼音输入法  双拼编码方案\n\n兼容微软拼音输入法双拼方案\n\n双拼编码将在输入法下次使用双拼时启用。\n\n[声母]\nch=U\nsh=I\nzh=V\n\n[韵母]\nai=S\nan=F\nang=G\nao=D\nei=W\nen=R\neng=T\ner=Q\nia=B\nian=J\niang=H\niao=K\nie=M\nin=L\ning=Q\niong=Y\niu=N\nong=Y\nou=P\nua=B\nuai=X\nuan=C\nuai=X\nuan=C\nuang=H\nue=X\nui=V\nun=Z\nuo=O\n\n[零声母音节的韵母]\na=AA\ne=EE\no=OO\n",-1);
		gtk_text_buffer_get_end_iter(buf1,&iter); 
    	    	
    }else if(double_pin_strategy)
    {		
 		gtk_text_buffer_get_end_iter(buf1,&iter);
 		//gtk_text_buffer_insert(buf1,&iter,"ch = I       ai = L	a = A\n",-1);
 		gtk_text_buffer_insert(buf1,&iter,"紫光拼音输入法  双拼编码方案\n\n兼容中文之星新双拼方案\n\n双拼编码将在输入法下次使用双拼时启用.\n\n[声母]\nch=I\nsh=U\nzh=V\n\n[韵母]\n\nai=L\nan=J\nang=H\nao=K\nei=Z\nen=F\neng=G\ner=R\nia=W\nian=M\niang=D\niao=C\nie=X\nin=N\ning=;\niong=S\niu=Q\nong=S\nou=B\nua=W\nuai=Y\nuan=R\nuai=Y\nuan=R\nuang=D\nue=T\nui=V\nun=P\nuo=O\nv=y\nve=T\n\n[零声母音节的韵母]\na=OA\nai=OL\nan=OJ\nang=OH\nao=OK\ne=OE\nei=OZ\nen=OF\neng=OG\ner=OR\no=OO\nou=OB\n",-1);
		gtk_text_buffer_get_end_iter(buf1,&iter); 
    	  	
    	    	
    }else{
    	gtk_text_buffer_get_end_iter(buf1,&iter);
 		gtk_text_buffer_insert(buf1,&iter,"紫光拼音输入法  双拼编码方案\n\n  您可以按照以下格式来自定义双拼编码方案。\n以分号;打头的行是注释，不处理,韵母ve与ue等价。\n双拼编码范围为英文字母键(A到Z)和分号键“;”。\n在此文件中，为了看起来醒目起见，双拼编码采用大写英文字母；\n而在实际输入过程中，只能使用小写英文字母。\n\n[声母]\n双拼编码就是它本身的声母不必列出\nch=A\nsh=I\nzh=U\n\n[韵母]\n双拼编码就是它本身的韵母不必列出\nai=P\nan=R\nang=S\nao=Q\nei=K\nen=W\neng=T\ner=J\nia=X\nian=\niang=G\niao=B\nie=D\nin=Y\ning=C\ning=;\niong=H\niu=J\nong=H\nou=Z\nua=X\nuai=Y\nuan=L\nuang=G\nue=N\nve=N\nui=N\nun=\nuo=O\n\n[零声母音节的韵母]\n 在零声母音节情况下，韵母优先使用本节中的定义：本节中有定义时\n使用本节中的定义，本节中未定义时使用“韵母”节中的定义。\na=OA\nai=OP\nan=OR\nang=OS\nao=OQ\ne=OE\nei=OK\nen=OW\neng=OT\ner=OJ\no=OO\nou=OZ\n",-1);
           gtk_text_buffer_get_end_iter(buf1,&iter);
} 
		

	
			
//信号绑定
	glade_xml_signal_connect(xml_upimdpref, "gtk_widget_destroy",
			G_CALLBACK(on_upimdpref_Window_destroy));

	
	w = glade_xml_get_widget(xml_upimdpref, "radiobutton1");
	g_signal_connect(GTK_TOGGLE_BUTTON(w),
			"toggled",
			G_CALLBACK(on_radiobutton1_toggled),
			xml_upimdpref);
	
	w = glade_xml_get_widget(xml_upimdpref, "radiobutton2");
	g_signal_connect(GTK_TOGGLE_BUTTON(w),
			"toggled",
			G_CALLBACK(on_radiobutton2_toggled),
			xml_upimdpref);

	w = glade_xml_get_widget(xml_upimdpref, "radiobutton3");
	g_signal_connect(GTK_TOGGLE_BUTTON(w),
			"toggled",
			G_CALLBACK(on_radiobutton3_toggled),
			xml_upimdpref);
	
	w = glade_xml_get_widget(xml_upimdpref, "radiobutton4");
	g_signal_connect(GTK_TOGGLE_BUTTON(w),
			"toggled",
			G_CALLBACK(on_radiobutton4_toggled),
			xml_upimdpref);

	glade_xml_signal_connect(xml_upimdpref, "on_radiobutton5_toggled",
			G_CALLBACK(on_radiobutton5_toggled));

	glade_xml_signal_connect(xml_upimdpref, "on_radiobutton6_toggled",
			G_CALLBACK(on_radiobutton6_toggled));

	glade_xml_signal_connect(xml_upimdpref, "on_radiobutton9_toggled",
			G_CALLBACK(on_radiobutton9_toggled));

	glade_xml_signal_connect(xml_upimdpref, "on_radiobutton10_toggled",
			G_CALLBACK(on_radiobutton10_toggled));

	glade_xml_signal_connect(xml_upimdpref, "on_radiobutton11_toggled",
			G_CALLBACK(on_radiobutton11_toggled));

	glade_xml_signal_connect(xml_upimdpref, "on_radiobutton12_toggled",
			G_CALLBACK(on_radiobutton12_toggled));

	glade_xml_signal_connect(xml_upimdpref, "on_radiobutton13_toggled",
			G_CALLBACK(on_radiobutton13_toggled));

	glade_xml_signal_connect(xml_upimdpref, "on_radiobutton14_toggled",
			G_CALLBACK(on_radiobutton14_toggled));

	w = glade_xml_get_widget(xml_upimdpref, "checkbutton1");
	g_signal_connect(GTK_TOGGLE_BUTTON(w),
			"toggled",
			G_CALLBACK(on_checkbutton1_toggled),
			NULL);
	
	w = glade_xml_get_widget(xml_upimdpref, "checkbutton2");
	g_signal_connect(GTK_TOGGLE_BUTTON(w),
			"toggled",
			G_CALLBACK(on_checkbutton2_toggled),
			NULL);

	w = glade_xml_get_widget(xml_upimdpref, "checkbutton3");
	g_signal_connect(GTK_TOGGLE_BUTTON(w),
			"toggled",
			G_CALLBACK(on_checkbutton3_toggled),
			NULL);

	w = glade_xml_get_widget(xml_upimdpref, "checkbutton4");
	g_signal_connect(GTK_TOGGLE_BUTTON(w),
			"toggled",
			G_CALLBACK(on_checkbutton4_toggled),
			NULL);

	w = glade_xml_get_widget(xml_upimdpref, "checkbutton5");
	g_signal_connect(GTK_TOGGLE_BUTTON(w),
			"toggled",
			G_CALLBACK(on_checkbutton5_toggled),
			NULL);

	w = glade_xml_get_widget(xml_upimdpref, "checkbutton6");
	g_signal_connect(GTK_TOGGLE_BUTTON(w),
			"toggled",
			G_CALLBACK(on_checkbutton6_toggled),
			NULL);

	w = glade_xml_get_widget(xml_upimdpref, "checkbutton7");
	g_signal_connect(GTK_TOGGLE_BUTTON(w),
			"toggled",
			G_CALLBACK(on_checkbutton7_toggled),
			NULL);

	w = glade_xml_get_widget(xml_upimdpref, "checkbutton8");
	g_signal_connect(GTK_TOGGLE_BUTTON(w),
			"toggled",
			G_CALLBACK(on_checkbutton8_toggled),
			NULL);

	w = glade_xml_get_widget(xml_upimdpref, "checkbutton9");
	g_signal_connect(GTK_TOGGLE_BUTTON(w),
			"toggled",
			G_CALLBACK(on_checkbutton9_toggled),
			NULL);

	w = glade_xml_get_widget(xml_upimdpref, "checkbutton10");
	g_signal_connect(GTK_TOGGLE_BUTTON(w),
			"toggled",
			G_CALLBACK(on_checkbutton10_toggled),
			NULL);

	w = glade_xml_get_widget(xml_upimdpref, "checkbutton11");
	g_signal_connect(GTK_TOGGLE_BUTTON(w),
			"toggled",
			G_CALLBACK(on_checkbutton11_toggled),
			NULL);

	w = glade_xml_get_widget(xml_upimdpref, "checkbutton12");
	g_signal_connect(GTK_TOGGLE_BUTTON(w),
			"toggled",
			G_CALLBACK(on_checkbutton12_toggled),
			NULL);

	w = glade_xml_get_widget(xml_upimdpref, "checkbutton13");
	g_signal_connect(GTK_TOGGLE_BUTTON(w),
			"toggled",
			G_CALLBACK(on_checkbutton13_toggled),
			NULL);

	w = glade_xml_get_widget(xml_upimdpref, "checkbutton14");
	g_signal_connect(GTK_TOGGLE_BUTTON(w),
			"toggled",
			G_CALLBACK(on_checkbutton14_toggled),
			NULL);
	
	w = glade_xml_get_widget(xml_upimdpref, "checkbutton15");
	g_signal_connect(GTK_TOGGLE_BUTTON(w),
			"toggled",
			G_CALLBACK(on_checkbutton15_toggled),
			NULL);

	w = glade_xml_get_widget(xml_upimdpref, "checkbutton16");
	g_signal_connect(GTK_TOGGLE_BUTTON(w),
			"toggled",
			G_CALLBACK(on_checkbutton16_toggled),
			NULL);

	w = glade_xml_get_widget(xml_upimdpref, "checkbutton17");
	g_signal_connect(GTK_TOGGLE_BUTTON(w),
			"toggled",
			G_CALLBACK(on_checkbutton17_toggled),
			NULL);

	w = glade_xml_get_widget(xml_upimdpref, "checkbutton18");
	g_signal_connect(GTK_TOGGLE_BUTTON(w),
			"toggled",
			G_CALLBACK(on_checkbutton18_toggled),
			NULL);

	w = glade_xml_get_widget(xml_upimdpref, "checkbutton19");
	g_signal_connect(GTK_TOGGLE_BUTTON(w),
			"toggled",
			G_CALLBACK(on_checkbutton19_toggled),
			NULL);
	
	w = glade_xml_get_widget(xml_upimdpref, "checkbutton20");
	g_signal_connect(GTK_TOGGLE_BUTTON(w),
			"toggled",
			G_CALLBACK(on_checkbutton20_toggled),
			NULL);	

	w = glade_xml_get_widget(xml_upimdpref, "checkbutton21");
	g_signal_connect(GTK_TOGGLE_BUTTON(w),
			"toggled",
			G_CALLBACK(on_checkbutton21_toggled),
			NULL);
	
	w = glade_xml_get_widget(xml_upimdpref, "checkbutton22");
	g_signal_connect(GTK_TOGGLE_BUTTON(w),
			"toggled",
			G_CALLBACK(on_checkbutton22_toggled),
			NULL);
			
	w = glade_xml_get_widget(xml_upimdpref, "checkbutton23");
	g_signal_connect(GTK_TOGGLE_BUTTON(w),
			"toggled",
			G_CALLBACK(on_checkbutton23_toggled),
			NULL);
			
	w = glade_xml_get_widget(xml_upimdpref, "checkbutton24");
	g_signal_connect(GTK_TOGGLE_BUTTON(w),
			"toggled",
			G_CALLBACK(on_checkbutton24_toggled),
			NULL);
	
	w = glade_xml_get_widget(xml_upimdpref, "checkbutton25");
	g_signal_connect(GTK_TOGGLE_BUTTON(w),
			"toggled",
			G_CALLBACK(on_checkbutton25_toggled),
			xml_upimdpref);
		
	w = glade_xml_get_widget(xml_upimdpref, "comboboxentry1");
	g_signal_connect(GTK_COMBO_BOX(w),
			"changed",
            G_CALLBACK(on_comboboxentry1_changed),
			xml_upimdpref);

	w = glade_xml_get_widget(xml_upimdpref, "comboboxentry2");
	g_signal_connect(GTK_COMBO_BOX(w),
			"changed",
            G_CALLBACK(on_comboboxentry2_changed),
			xml_upimdpref);

	w = glade_xml_get_widget(xml_upimdpref, "comboboxentry3");
	g_signal_connect(GTK_COMBO_BOX(w),
			"changed",
            G_CALLBACK(on_comboboxentry3_changed),
			xml_upimdpref);

	w = glade_xml_get_widget(xml_upimdpref, "comboboxentry4");
	g_signal_connect(GTK_COMBO_BOX(w),
			"changed",
            G_CALLBACK(on_comboboxentry4_changed),
			xml_upimdpref);

	w = glade_xml_get_widget(xml_upimdpref, "comboboxentry5");
	gtk_combo_box_set_wrap_width(GTK_COMBO_BOX(w),10); 
	g_signal_connect(GTK_COMBO_BOX(w),
			"changed",
            G_CALLBACK(on_comboboxentry5_changed),
			xml_upimdpref);

	w = glade_xml_get_widget(xml_upimdpref, "comboboxentry6");
	g_signal_connect(GTK_COMBO_BOX(w),
			"changed",
            G_CALLBACK(on_comboboxentry6_changed),
			xml_upimdpref);

	w = glade_xml_get_widget(xml_upimdpref, "button1");
	g_signal_connect(GTK_OBJECT(w),
			"clicked",
			G_CALLBACK(on_button1_clicked),
			xml_upimdpref);

	w = glade_xml_get_widget(xml_upimdpref, "button2");
	g_signal_connect(GTK_OBJECT(w),
			"clicked",
			G_CALLBACK(on_button2_clicked),
			xml_upimdpref);

	w = glade_xml_get_widget(xml_upimdpref, "button3");
	g_signal_connect(GTK_OBJECT(w),
			"clicked",
			G_CALLBACK(on_button3_clicked),
			xml_upimdpref);
	/*		
	w = glade_xml_get_widget(xml_upimdpref, "windowupimdpref");
	gtk_window_set_position(GTK_WINDOW(w),GTK_WIN_POS_CENTER);
	gtk_widget_show(w);
	*/
}
//zzc

// vi:ts=4:nowrap:cin:expandtab
